package com.landiao.common.pojo;

import java.io.Serializable;
import java.util.List;

public class Page<T> implements Serializable {

	private static final long serialVersionUID = -7855753729299761446L;

	private List<T> rows;
	private int total;//总页数
	private int page;
	private int records;//总记录数
	private int pageSize = 10;
	
	public Page(){
		
	}
	
	public Page(Querier querier){
		this.pageSize = querier.getRows();
		this.page = querier.getPage();
	}
	
	public Page(int pageSize,int page){
		this.pageSize = pageSize;
		this.page = page;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRecords() {
		return records;
	}

	public void setRecords(int records) {
		this.total = records/pageSize+(records%pageSize>0?1:0);
		this.records = records;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

}
